Skip to content

fix(@angular/build): inherit preserveSymlinks option from build target in unit-test builder#33452

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:fix-symlinked-imports-unit-test
Jun 25, 2026
Merged

fix(@angular/build): inherit preserveSymlinks option from build target in unit-test builder#33452
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:fix-symlinked-imports-unit-test

Conversation

@clydin

@clydin clydin commented Jun 24, 2026

Copy link
Copy Markdown
Member

The unit-test builder did not pass the preserveSymlinks configuration to Vitest's custom configuration plugin and resolved it directly from buildTargetOptions in Karma executor without considering process arguments. This caused module resolution failures in unit tests for symlinked packages.

This change inherits preserveSymlinks from the referenced buildTarget options, falling back to process.execArgv if not defined. The resolved value is then successfully forwarded to the underlying bundlers and executors (Karma and Vitest).

…t in unit-test builder

The unit-test builder did not pass the preserveSymlinks configuration to Vitest's custom configuration plugin and resolved it directly from buildTargetOptions in Karma executor without considering process arguments. This caused module resolution failures in unit tests for symlinked packages.

This change inherits preserveSymlinks from the referenced buildTarget options, falling back to process.execArgv if not defined. The resolved value is then successfully forwarded to the underlying bundlers and executors (Karma and Vitest).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the preserveSymlinks option in the unit-test builder. It resolves the option from either the build target options or the process execution arguments, and propagates it to both the Karma and Vitest test runners, ensuring consistent symlink resolution behavior during testing. I have no feedback to provide as there are no review comments.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Jun 24, 2026
@clydin clydin requested a review from alan-agius4 June 24, 2026 20:23
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 24, 2026
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 25, 2026
@alan-agius4 alan-agius4 linked an issue Jun 25, 2026 that may be closed by this pull request
1 task
@alan-agius4 alan-agius4 merged commit dc27e17 into angular:main Jun 25, 2026
43 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the fix-symlinked-imports-unit-test branch June 25, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unit-test builder fails to resolve nested imports in symlinked packages

2 participants